#include <iostream>
using namespace std;
int main()
{
//	1  1+1 1+2 1+3   1+4 1+5  1+6
//	1	2	3	4	  5	  6	   7
//	x x+k x+2k x+3k x+4k x+5k x+6k = 7x+21k = n
	int n;
	int x = 0;
	int y = 0;
	int k1 = 0;
	cin >> n;
	n = n / 52;
	for(int k = 1;k<=n;k++)
	{
		x = (n-21*k) % 7;
		y = (n-21*k) / 7;
		if(x == 0 && y<=100)
		{
			k1 = k;
			break;
		}
	}
	cout << y << endl;
	cout << k1 << endl;
	
	return 0;
}
